package com.kai.steering.data.service.service;

import com.kai.steering.data.service.entity.AnswerResult;
import com.kai.steering.data.service.entity.domainObject.AnswerDO;
import com.kai.steering.data.service.entity.domainObject.QuestionDetailsDO;
import com.kai.steering.data.service.entity.dto.AnswerQueryDTO;
import com.kai.steering.data.service.entity.po.Answer;
import com.kai.steering.common.web.service.BaseService;
import com.kai.steering.common.vo.Page;
import com.kai.steering.data.service.entity.vo.AnswerVO;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * <pre>
 * 答案 服务类
 * </pre>
 *
 * @author kai
 * @since 2022-02-23
 */
public interface AnswerService extends BaseService<Answer> {

    /**
     * 保存
     *
     * @param answerDO
     * @return
     */
    AnswerDO saveAnswer(AnswerDO answerDO);

    /**
     * 批量保持
     * @param answerDOs
     */
    List<AnswerDO>  saveAnswerBatch(List<AnswerDO> answerDOs);
    /**
     * 修改
     *
     * @param answerDO
     * @return
     */
    boolean updateAnswer(Serializable id, AnswerDO answerDO);

    /**
     * 删除
     *
     * @param id
     * @return
     */
    boolean deleteAnswer(Serializable id);

    /**
     * 根据ID获取
     *
     * @param answerId
     * @return
     */
    AnswerDO getAnswerById(Serializable answerId);

    List<AnswerDO> getAnswerByQId(Serializable questionId);
    Map<String, AnswerDO> getAnswerByQId(List<String> questionId);

    /**
     * 获取所有对象
     *
     * @return
     */
    List<AnswerVO> getAllAnswer();

    /**
     * 获取分页对象
     *
     * @param answer
     * @return
     */
    Page<AnswerVO> getAnswerPageList(AnswerQueryDTO answer);

    /**
     * 判断某属性是否存在
     *
     * @param key
     * @param val
     * @param id
     * @return
     */
    boolean isExists(String key, String val, Serializable id);


    /**
     * 获取答案
     * @param answerDO
     * @return
     */
    AnswerResult replyAnswer(AnswerDO answerDO);
}

